﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;


namespace IHISCETeim.BLL
{
    /// <summary>
    /// 5.机器维保费收入记录(FTradeUpKeep)
    /// </summary>
    public class FTradeUpKeepController : BaseController
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static int Add(FTradeUpKeepInfo obj)
        {
            return FTradeUpKeepDAL.Add(obj);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool Delete(int id)
        {
            return FTradeUpKeepDAL.Delete(id);
        }
        /// <summary>
        /// 根据主表ID获取所有的维护记录
        /// </summary>
        /// <param name="FTradeID"></param>
        /// <returns></returns>
        public static List<FTradeUpKeepInfo> GetAllByFTradeID(int FTradeID)
        {
            return  CBO.FillCollection< FTradeUpKeepInfo>( FTradeUpKeepDAL.GetAllByFTradeID(FTradeID));
        }

        public static FTradeUpKeepInfo GetById(int ID)
        {
            return CBO.FillObject<FTradeUpKeepInfo>(FTradeUpKeepDAL.GetById(ID));
        }

        public static bool Update(FTradeUpKeepInfo obj)
        {
            return FTradeUpKeepDAL.Update(obj);
        }
    }
}
